package org.apm.data.pusher;

import java.util.HashSet;
import java.util.Set;

import org.elasticsearch.action.admin.indices.get.GetIndexResponse;
import org.elasticsearch.client.Client;

import com.alibaba.fastjson.JSON;

public class EsSearch {
    
    /** get all indices. */
    public static Set<String> getIndics(Client client) {
        Set<String> indices = new HashSet<String>();
        GetIndexResponse searchResponse = client.admin().indices().prepareGetIndex()
                .setIndices(Config.apmIndex + "*").execute().actionGet();
        System.out.println(JSON.toJSONString(searchResponse.getIndices()));
        return indices;
    }
}
